package com.ailk.evaluation.evaluation;

import java.util.HashMap;
import java.util.Vector;

public class EvaluationPlan {
	
	private String id;
	private String name;
	private String remark;
	private String templateId;
	
	private EvaluationTemplate template;
	private Vector<EvaluationEntryScore> scorePercent;
	private HashMap<String, EvaluationEntryScore> percentMap;
	
	public EvaluationPlan(){
		scorePercent = new Vector<EvaluationEntryScore>();
		percentMap = new HashMap<String, EvaluationEntryScore>();
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getTemplateId() {
		return templateId;
	}

	public void setTemplateId(String templateId) {
		this.templateId = templateId;
	}

	public EvaluationTemplate getTemplate() {
		return template;
	}

	public void setTemplate(EvaluationTemplate template) {
		this.template = template;
	}

	public EvaluationEntryScore[] getScorePercent() {
		return (EvaluationEntryScore[])scorePercent.toArray();
	}

	public void setScorePercent(EvaluationEntryScore[] scorePercent) {
		this.scorePercent = new Vector<EvaluationEntryScore>();
		this.percentMap = new HashMap<String, EvaluationEntryScore>();
		for(int i = 0; i < scorePercent.length; i++){
			this.scorePercent.add(scorePercent[i]);
			this.percentMap.put(scorePercent[i].getEntryId(), scorePercent[i]);
		}
	}
	
	public EvaluationEntryScore getScorePercentById(String id) {
		return percentMap.get(id);
	}
	
}
